#@adminLayout() #define main()
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <!--<div class="col-sm-12 search-collapse">
            <form id="data-form">
                <div class="select-list">
                    <ul>
                        <li>
                            缓存名称：<input type="text" name="keyname"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>-->

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" >
                <i class="fa fa-remove"></i> 删除
            </a>

            <a class="btn btn-danger" onclick="clearAll()" >
                <i class="fa fa-remove"></i> 清理全部缓存
            </a>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<script type="text/javascript">
    var prefix = "ehcache_list";
    $(function() {
        var options = {
            url: prefix + "/list",
            removeUrl: prefix + "/remove",
            //queryParams: queryParams,
            pagination:false,
            modalName: "数据",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '缓存名'
                },
                {
                    field: 'value',
                    title: '缓存'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });

    /*function queryParams(params) {
        var search = $.table.queryParams(params);
        search.dictType = $("#dictType").val();
        return search;
    }*/

    function clearAll()
    {
        $.modal.confirm("确定清理全部缓存吗？", function() {
            $.operate.post(prefix + "/clearAll",{});
        });
    }
</script>
</body>
#end